package entities;

public class Book {
    private String title;
    private String author;
    private double price;
    private String type;
    private boolean isBorrowed;

    public Book (String title,String author,double price,String type){
        this.title = title;
        this.author = author;
        this.price = price;
        this.type = type;
        this.isBorrowed = false;
    }

    public String getTitle() {return title;}
    public String getAuthor() {return author;}
    public double getPrice() {return price;}
    public String getType() {return type;}
    public boolean isBorrowed() {return isBorrowed;}
    public void setBorrowed(boolean borrowed) { isBorrowed = borrowed;}

    @Override
    public String toString(){
        return "《" + title + "》 by" + author + ", type" + type + " , price: " + price + ", Borrowed: " + (isBorrowed?"已借出":"未借出");
    }
}
